package com.yshy.moviechoseseatinginnerapi.controller;

import com.yshy.moviechoseseatinginnerapi.service.CinemasService;
import com.yshy.moviechoseseatingcommon.entity.bo.cinemas.GetByIdBo;
import com.yshy.moviechoseseatingcommon.entity.bo.cinemas.V1PagedQueryBo;
import com.yshy.moviechoseseatingcommon.entity.bo.cinemas.V2PagedQueryBo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 *影院api
 * @create: 下午1:41
 **/
@RestController
@RequestMapping("/cinemas")
public class CinemasController {
    @Autowired
    private CinemasService cinemasService;
    /**
     * 根据影院id查询影院
     * @return
     */
    @PostMapping("/getById")
    public String getById(@RequestBody @Valid GetByIdBo bo){
        return cinemasService.getById(bo);
    }
    /**
     * 分页查询城市影院(v1)
     * @return
     */
    @PostMapping("/v1PagedQuery")
    public String v1PagedQuery(@RequestBody @Valid V1PagedQueryBo bo){
        return cinemasService.v1PagedQuery(bo);
    }
    /**
     * 分页查询城市影院(v2)
     * @return
     */
    @PostMapping("/v2PagedQuery")
    public String v2PagedQuery(@RequestBody @Valid V2PagedQueryBo bo){
        return cinemasService.v2PagedQuery(bo);
    }
    /**
     * 查询所有影院品牌
     * @return
     */
    @PostMapping("/listAllBrands")
    public String listAllBrands(){
        return cinemasService.listAllBrands();
    }
}
